﻿#ifndef VIDEORECORDER_H
#define VIDEORECORDER_H

#include <QObject>
#include "opencv2/core.hpp"
#include "opencv2/highgui.hpp"
class VideoRecorder
{
public:
    VideoRecorder();
public slots:
    void setFrameRate(int value);
    void setMaxTime(int value);
    void setRecodeTime(int value);

    /**
     * @brief record 将图像存入视频。会对图像进行适当的缩小和裁剪
     * @param image
     */
    void record(QImage &image);
private:
    cv::VideoWriter *m_writer;
    int m_fps;      // 视屏帧率, range(1, 60), 根据当前显示屏60Hz设置视屏帧率上限
    int m_recodeMaxTime;    // 视屏录制时间上限,1~600s, 到上限后停止录制视屏
    int m_recodeTime;       // 视屏录制时间1~600s
};

#endif // VIDEORECORDER_H
